package com.talent.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.talent.web.mapper.TlUserMapper;
import com.talent.web.model.entity.TlUser;
import com.talent.web.service.ITlUserService;
import org.springframework.stereotype.Service;

/**
 * @ClassName：TlUserServiceImpl
 * @Author: hszhou
 * @Date: 2025/3/19 15:12
 * @Description: 必须描述类做什么事情, 实现什么功能
 */
@Service
public class TlUserServiceImpl extends ServiceImpl<TlUserMapper, TlUser> implements ITlUserService {
    @Override
    public TlUser findUserByOpenId(String openid) {
        LambdaQueryWrapper<TlUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TlUser::getOpenId,openid);
        return this.getOne(wrapper);
    }

    @Override
    public TlUser selectUserByUsername(String username) {
        LambdaQueryWrapper<TlUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TlUser::getUsername,username);
        return this.getOne(wrapper);
    }

    @Override
    public TlUser selectUserByPhone(String phone) {
        LambdaQueryWrapper<TlUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TlUser::getPhone,phone);
        return this.getOne(wrapper);
    }
}
